// pages/msg/msg.js
Page({

        /**
         * 页面的初始数据
         */
        data: {     
                user: [
                       {
                                name:"陈彩棉",
                                msg:'你好',
                                time:'上午1:30',
                                img:'../../imgs/icon/选中我的.png'         
                        },        
                       {
                                name:"代志富",
                                msg:'你好我是代志富，我的家在你好你好年后',   
                                time:'昨天',
                                img:'../../imgs/icon/选中我的.png'      
                        },     
                ],
                a:[]
        },
        onLoad: function (options) {
                wx.setNavigationBarTitle({
                        title: '我的好友'
                        })
        },
        onShow: function () {
        },
        liaotian(a){
                console.log(a)
                var index = a.currentTarget.dataset.index
                wx.navigateTo({
                  url: './chat/chat?data=' + encodeURIComponent(JSON.stringify(this.data.user[index])),
                })
        },
        search_user(){
                this.setData({
                        xianshi:true
                })
        },
        guanbi(){
                this.setData({
                        xianshi:false
                })
        }
})